//可编辑的用于显示bug详细信息的form表单
var testProjectBugDetailForm = Ext.create('Ext.form.Panel', {
    header: false,
    bodyPadding: 10,
    border: false,
    defaults: {
        anchor: '100%',
        layout: 'column', //默认定义组件内部元素为布局为列布局方式
        border: false
    },
    items: [{
        defaults: {
            border: false,
            layout: 'form',
        },
        items: [{
            columnWidth: 1, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'textfield',
                labelWidth: 50,
                allowBlank: false,
                fieldLabel: '名称',
                emptyText: '限制字数',
                itemId: 'title'
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form',
            margin: '20 0 0 0'
        },
        items: [{
            columnWidth: 1, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                labelWidth: 50,
                fieldLabel: '提交人',
                itemId: 'author'
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form',
            margin: '20 0 0 0'
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                fieldLabel: '对应测试需求:',
                labelWidth: 70,
                itemId: 'toTrq'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'button',
                text: '选择',
                itemId: 'trqButton',
                listeners: [{
                    click: function () {
                        testProjectBugChooseTrqTreePanelStore.proxy.url = zuulUrl + '/' + testServiceName + '/common/testRequirement/project/' + testDesignProject
                        testProjectBugChooseTrqTreePanelStore.reload();
                        testProjectBugChooseTrqWin.show();
                    }
                }]
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form',
            margin: '20 0 0 0'
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                fieldLabel: '创建时间:',
                labelWidth: 70,
                itemId: 'createDate',
                renderer: function (v, m, r) {
                    return v == null || v == '' ? '' : v.replace('T', '  ');//使用reset()会分别经历null和空字符串
                }
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'displayfield',
                fieldLabel: '最近更新:',
                labelWidth: 70,
                itemId: 'updateDate',
                renderer: function (v, m, r) {
                    return v == null || v == '' ? '' : v.replace('T', '  ');
                }
            }]
        }]
    }, {
        fieldLabel: '描述信息',
        margin: '20 0 0 5',
        allowBlank: false,
        labelWidth: 70,
        xtype: 'textareafield',
        height: '55%',
        itemId: 'describe',
        cls: 'x-form-valid',
        emptyText: '填写描述信息'
    }]
});